/**
 * 
 */
package org.tarpoon.nexus.monitoring;

import javax.inject.Inject;
import javax.inject.Named;

import org.sonatype.configuration.ConfigurationException;
import org.sonatype.nexus.plugins.RepositoryCustomizer;
import org.sonatype.nexus.proxy.repository.Repository;
import org.sonatype.nexus.proxy.repository.RequestProcessor;

/**
 * @author fdrouet
 */
public class MonitoringRepositoryCustomiser implements RepositoryCustomizer {

  @Inject
  private @Named("statisticsColector")
  RequestProcessor statisticsRequestProcessor;

  public void configureRepository(Repository repository) throws ConfigurationException {
    repository.getRequestProcessors().put("statisticsColector", this.statisticsRequestProcessor);

  }

  public boolean isHandledRepository(Repository repository) {
    return true;
  }

}
